﻿<%@ Page Language="C#" Title="公路技术状况评定明细" MasterPageFile="~/W_View/PageMaster.Master" CodeBehind="E_RoadWaydetailPage.aspx.cs" Inherits="STHPMS1.Web.W_View.Evaluate.E_RoadWaydetailPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/datagrid.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/Control/dropdown.js")%>
     <%= UiHelper.RefJsFileHtml("/Scripts/TypeScript/Enum.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/TypeScript/JsPage.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/TypeScript/Appearance.js")%>
    <%= UiHelper.RefJsFileHtml("/Scripts/TypeScript/Bussiness.js")%>
    <script type="text/javascript">
       

        var _css = new Appearance();
        

        

     
        function search(n, o) {

            window.alert("1213");
            /*
            var inspecid = $('#cmbInspecid').combobox("getValue"); //评定名称
            alert(inspecid);
            var road = $('#cmbRoadway').combobox("getValue"); //路线编号
            //var admdiv = $("#Admdiv").val();
            console.log(inspecid);
            console.log(road);
            //console.log(admdiv);
           
            var inspecid = $('#cmbInspecid').combobox("getValue");
            var d = $('#cmbDirection').combobox("getValue");
            var url = '/api/roadwaydetail';
            var urlParam = "";
            if (road != "" && road != "0") urlParam += "road=" + encodeURI(road) + "&";
            if (inspecid != "" && inspecid != "0") urlParam += "inspecid=" + encodeURI(inspecid) + "&";
            if (d != "" && d != "0") urlParam += "d=" + encodeURI(d) + "&";

            if (urlParam != "") {
                urlParam = "?" + urlParam.substring(0, urlParam.length - 1);
                url = url + urlParam;
            }

            $('#dg').datagrid({ url: url, pageNumber: 1 });
            */
        }

        function search1(n, o) {
            //window.alert("1213");

            var inspecid = $('#cmbInspecid').combobox("getValue"); //评定名称
            var road = $('#cmbRoadway').combobox("getValue"); //路线编号
            var admdiv = $("#Admdiv").combotree("getValue"); //行政区域
            var admgrd = $('#Admgrd').combobox("getValue"); //行政等级
            var rd = $('#Rdclass_Dictid').combobox("getValue"); //技术等级
            var pvmttype = $('#Pvmttype').combobox("getValue"); //路面类型

            //console.log("111");

            var manaut = $('#Manaut').textbox("getValue"); //管养单位


            console.log(inspecid);
            console.log(road);
            console.log(admdiv);
            console.log(admgrd);
            console.log(rd);
            console.log(pvmttype);
            console.log(manaut);

            /*
            var road = $('#cmbRoads').combobox("getValue");
            var inspecid = $('#cmbInspecid').combobox("getValue");
            */
            var url = '/api/roadwaydetail';
            var urlParam = "";
            
            if (inspecid != "" && inspecid != "0") urlParam += "inspecid=" + encodeURI(inspecid) + "&";
            if (road != "" && road != "0") urlParam += "road=" + encodeURI(road) + "&";
            if (admdiv != "" && admdiv != "0") urlParam += "admdiv=" + encodeURI(admdiv) + "&";
            if (admgrd != "" && admgrd != "0") urlParam += "admgrd=" + encodeURI(admgrd) + "&";
            if (rd != "" && rd != "0") urlParam += "rd=" + encodeURI(rd) + "&";
            if (pvmttype != "" && pvmttype != "0") urlParam += "pvmttype=" + encodeURI(pvmttype) + "&";
            if (manaut != "" && manaut != "0") urlParam += "manaut=" + encodeURI(manaut) + "&";

            if (urlParam != "") {
                urlParam = "?" + urlParam.substring(0, urlParam.length - 1);
                url = url + urlParam;
            }

            $('#dg').datagrid({ url: url, pageNumber: 1 });
            
        }


        $(function () {
            var number = '<%= Page.RouteData.Values["page"] %>';
            var size = '<%= Page.RouteData.Values["size"] %>';

            loadAdmDiv();
            dataGridBind($('#dg'), '/api/roadwaydetail', '单元评定明细（按每公里）', $('#tb'), number, size);

            $('.validatebox-text').bind('blur', function () {
                $(this).validatebox('enableValidation').validatebox('validate');
            });
        })

    </script>    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table id="dg" class="easyui-datagrid content-place"  ajaxCached="false"  >
        <thead>
            <tr>
                <th rowspan="2" data-options="field:'Inspecid',editor:'text',width:100,align:'right' ">评定名称</th>
                <th rowspan="2" data-options="field:'Rdwayid',editor:'numberbox',width:80,align:'right' ">路线编号</th>
                <th rowspan="2" data-options="field:'Beginmp',editor:'text',width:100,align:'right',formatter:_css.formatStake">起点桩号</th>
                <th rowspan="2" data-options="field:'Endmp',editor:'text',width:100,align:'right' ,formatter:_css.formatStake">终点桩号</th>
                
                
                <th rowspan="2" data-options="field:'Direction_Dictid',editor:'numberbox',width:80,align:'right' " formatter="formatDirection">调查方向</th>
                <th rowspan="2" data-options="field:'Mqi',editor:'text',width:80,align:'right'" formatter="formatNumber">MQI</th>
                <th rowspan="2" data-options="field:'Pqi',editor:'text',width:80,align:'right'" formatter="formatNumber">PQI </th>

                <th colspan="5">路面分项指标</th>
                
                <th rowspan="2" data-options="field:'Sci',editor:'text',width:80,align:'right', precision:2" formatter="formatNumber">SCI</th>
                <th rowspan="2" data-options="field:'Bci',editor:'text',width:80,align:'right' , precision:2" formatter="formatNumber">BCI</th>
                <th rowspan="2" data-options="field:'Tci',editor:'text',width:80,align:'right' , precision:2" formatter="formatNumber">TCI</th>

            </tr>
           <tr>
                <th data-options="field:'Pci',editor:'text',width:80,align:'right' , precision:2" formatter="formatNumber">PCI</th>
                <th data-options="field:'Rqi',editor:'text',width:80,align:'right' , precision:2" formatter="formatNumber">RQI</th>
                <th data-options="field:'Rdi',editor:'text',width:80,align:'right' , precision:2" formatter="formatNumber">RDI</th>
                <th data-options="field:'Sri',editor:'text',width:80,align:'right' , precision:2" formatter="formatNumber">SRI</th>
                <th data-options="field:'Pssi',editor:'text',width:80,align:'right' , precision:2" formatter="formatNumber">PSSI</th>
           </tr>

        </thead>
    </table>
   
    <!--测试数据命令-->
    <div id="tb">

         <select id="cmbInspecid" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'评定名称',url:'/api/roadwaydetail/getinspecid',method:'get',valueField:'id',textField:'id',onSelect:function(rect){ 
                            var stfu_url = '/api/roadwaydetail/getroadwayid?inspecid='+rect.id;
                             
                            $('#cmbRoadway').combobox('reload', stfu_url).combobox('clear');
                        }">
         </select>
        <select id="cmbRoadway" class="easyui-combobox" panelHeight="80" style="width:100px" data-options="prompt:'路线编号',method:'get',valueField:'id',textField:'id'">
         </select>

        <input id='Admdiv' name='Admdiv'  class="easyui-combotree" style="width:200px" data-options="prompt:'行政区域',url:'/api/data/regioncode',method:'get'"/>
        <input id="Admgrd" name='Admgrd'  class="easyui-combobox" style="width:80px" data-options="prompt:'行政等级',valueField:'id',textField:'text',url:'/api/data/adminlevel',method:'get'"/>
        <input id="Rdclass_Dictid" name='Rdclass_Dictid'  class="easyui-combobox" style="width:80px" data-options="prompt:'技术等级',valueField:'id',textField:'text',url:'/api/data/roadclass',method:'get'"/>
        <input id="Pvmttype"  name='Pvmttype'  class="easyui-combobox" style="width:80px" data-options="prompt:'路面类型',valueField:'id',textField:'text',url:'/api/data/pavement',method:'get'"/>
        <input id="Manaut" name='Manaut' class='easyui-validatebox easyui-textbox' style="width:80px"  data-options="prompt:'管养单位',validType:'MaxLength[1000]'"/>

        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true" onclick="search1();">查询</a>
     
    </div>

   
</asp:Content>
